<?php

if(empty($cat)) { $cat = 'general options';}
if(empty($right_side)) {$right_side = '';}
if(empty($left_side)) {$left_side = '';}
if(empty($content)) {$content = '';}

if(empty($allow_register_no)) {$allow_register_no = '';}
if(empty($allow_video_upload_no)) {$allow_video_upload_no = '';}
if(empty($allow_youtube_videos_no)) {$allow_youtube_videos_no = '';}
if(empty($ffmpeg_supported_no)) {$ffmpeg_supported_no = '';}
if(empty($show_welcome_message_yes)) {$show_welcome_message_yes = '';}

$right_side = $right_side . quick_info('Quick Summary','
users count: '.get_users_count().'
<br>subtitles count: '.get_subtitles_count().'
<br>videos count: '.get_videos_count().'
');

$right_side = $right_side . "<br>" . quick_links('Quick Links','
<a href="http://sourceforge.net/projects/onlinesubtitles/forums/forum/1758498" target="_blank">Open Discussion</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<a href="http://sourceforge.net/tracker/?group_id=534975&atid=2172715" target="_blank">Bugs</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<a href="http://sourceforge.net/projects/onlinesubtitles/forums/forum/1758499" target="_blank">Help Forum</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<a href="http://sourceforge.net/tracker/?group_id=534975&atid=2172718" target="_blank">Feature Requests</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<a href="http://sourceforge.net/projects/onlinesubtitles/forums/forum/1761558" target="_blank">Security Forum</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
<a href="http://sourceforge.net/tracker/?group_id=534975&atid=2172716" target="_blank">Support Requests</a>
');

$options_list[0][0] = 'General options';
$options_list[0][1] = 'index.php?page=settings&cat=general options';

$left_side = $left_side . left_list('general options',$options_list);

if(read_option('allow_registeration')=="yes") {$allow_register_yes='selected="selected"';} else {$allow_register_no='selected="selected"';}
if(read_option('allow_video_upload')=="yes") {$allow_video_upload_yes='selected="selected"';} else {$allow_video_upload_no='selected="selected"';}
if(read_option('allow_youtube_videos')=="yes") {$allow_youtube_videos_yes='selected="selected"';} else {$allow_youtube_videos_no='selected="selected"';}
if(read_option('ffmpeg_supported')=="yes") {$ffmpeg_supported_yes='selected="selected"';} else {$ffmpeg_supported_no='selected="selected"';}
if(read_option('show_welcome_message')=="yes") {$show_welcome_message_yes='selected="selected"';} else {$show_welcome_message_no='selected="selected"';}

$content = $content . content_tabs($cat, "
                <div class='table'>
				<form method='post' action='index.php'>
                    <table class='listing form' cellpadding='0' cellspacing='0'>
                        <tr>
                            <th class='full' colspan='2'>general options</th>
                        </tr>
                        <tr>
                            <td width='172'><strong>site name:</strong></td>
                            <td><input type='text' name='site_name' value='".read_option('site_name')."' /></td>
                        </tr>
                        <tr>
                            <td><strong>site slogan:</strong></td>
                            <td><input type='text' name='site_slogan' value='".read_option('site_slogan')."' /></td>
                        </tr>
                        <tr>
                            <td><strong>forum url</strong></td>
                            <td><input type='text' name='forum_url' value='".read_option('forum_url')."' /></td>
                        </tr>
                        <tr>
                            <td><strong>community url</strong></td>
                            <td><input type='text' name='community_url' value='".read_option('community_url')."' /></td>
                        </tr>
                        <tr>
                            <td><strong>facebook</strong></td>
                            <td><input type='text' name='facebook' value='".read_option('facebook')."' /></td>
                        </tr>
                        <tr>
                            <td><strong>twitter</strong></td>
                            <td><input type='text' name='twitter' value='".read_option('twitter')."' /></td>
                        </tr>
                        <tr>
                            <td><strong>google analytics</strong></td>
                            <td><textarea name='google_analytics' cols='40' rows='4'>".read_option('google_analytics')."</textarea></td>
                        </tr>
                        <tr>
                            <td><strong>meta tags</strong></td>
                            <td><textarea name='meta_code' cols='40' rows='4'>".read_option('meta_tags')."</textarea></td>
                        </tr>
                        <tr>
                            <td><strong>allow user registration</strong></td>
                            <td>
							<select name='allow_register'>
							<option ".$allow_register_no." value='no'>NO</option>
							<option ".$allow_register_yes." value='yes'>YES</option>
							</select>
							</td>
                        </tr>
                        <tr>
                            <td><strong>allow video upload</strong></td>
                            <td>
							<select name='allow_video_upload'>
							<option value='no' ".$allow_video_upload_no.">NO</option>
							<option value='yes' ".$allow_video_upload_yes.">YES</option>
							</select>							
							</td>
                        </tr>
                        <tr>
                            <td><strong>allow youtube videos</strong></td>
                            <td>
							<select name='allow_youtube_videos'>
							<option value='no' ".$allow_youtube_videos_no.">NO</option>
							<option value='yes' ".$allow_youtube_videos_yes.">YES</option>
							</select>							
							</td>
                        </tr>
                        <tr>
                            <td><strong>ffmpeg is installed</strong></td>
                            <td>
							<select name='ffmpeg'>
							<option value='no' ".$ffmpeg_supported_no.">NO</option>
							<option value='yes' ".$ffmpeg_supported_yes.">YES</option>
							</select>							
							</td>
                        </tr>
                        <tr>
                            <td><strong>ffmpeg path</strong></td>
                            <td>
							<input type='text' name='ffmpeg_path' value='".read_option('ffmpeg_path')."'/>
							</td>
                        </tr>						
                        <tr>
                            <td><strong>show welcome message</strong></td>
                            <td>
							<select name='show_welcome_message'>
							<option value='no' ".$show_welcome_message_no.">NO</option>
							<option value='yes'".$show_welcome_message_yes.">YES</option>
							</select>							
							</td>
                        </tr>
                        <tr>
                            <td><strong>welcome message</strong></td>
                            <td>
							<textarea name='welcome_message' cols='40' rows='4' >".read_option('welcome_message')."</textarea>							
							</td>
                        </tr>							
						</table>
						<br>
						<input type='submit' value='save options' />
						<input type='hidden' name='page' value='settings' />
						<input type='hidden' name='cat' value='general options' />
						<input type='hidden' name='save_general_options' value='yes'/>
						</form>
                </div>
			
				
");

?>
